﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using NetDon.Utilities;

namespace NetDon.eBoss.Portal
{

    using WebControls;

    public partial class Error : NetDonPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                var context = ServiceContainer.GetService<ApplicationContext>();
                if (context.UserId == Guid.Empty)
                {
                    linkLoginPage.NavigateUrl = string.Format("javascript:window.top.location='{0}'",
                                                             ResolveUrl("~/Login.aspx"));
                    this.linkLoginPage.Visible = true;
                }
                else
                {
                    this.linkHomePage.Visible = true;
                }
            }
        }
    }
}
